package com.lobaby.tools.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 页面交互实体
 * @author lig
 */
public class ConsoleResult implements Serializable {
	private static final long serialVersionUID=1L;

	public static String successStatus = "success";
	public static String faultStatus   = "fault";
	
	public ConsoleResult() {
	}

	public ConsoleResult(String status, String errInfo, String msgInfo) {
		this.status = status;
		this.errInfo = errInfo;
		this.msgInfo = msgInfo;
	}
	
	private String status;
	private String errInfo;
	private String msgInfo;

	private List<?> list;
	private Object object;
	private Map<?,?> map=new HashMap<>();
	public String getErrInfo() {
		return errInfo;
	}
	public void setErrInfo(String errInfo) {
		this.errInfo = errInfo;
	}
	public String getMsgInfo() {
		return msgInfo;
	}
	public void setMsgInfo(String msgInfo) {
		this.msgInfo = msgInfo;
	}
	public List<?> getList() {
		return list;
	}
	public void setList(List<?> list) {
		this.list = list;
	}
	public Object getObject() {
		return object;
	}
	public void setObject(Object object) {
		this.object = object;
	}
	public Map<?,?> getMap() {
		return map;
	}
	public void setMap(Map<?,?> map) {
		this.map = map;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}

	public static ConsoleResult getErrObj(String errInfo) {
		return new ConsoleResult(ConsoleResult.faultStatus, errInfo, null);
	}

	public static ConsoleResult getSuccessObj(String msgInfo) {
		return new ConsoleResult(ConsoleResult.successStatus, null, msgInfo);
	}

	@Override
	public String toString() {
		return "ConsoleResult [status=" + status + ", errInfo=" + errInfo + ", msgInfo=" + msgInfo + "]";
	}
	
}
